<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/qt3support/widgets/q3datetimeedit.cpp -->
<head>
  <title>Qt 4.3: Q3DateTimeEdit Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3DateTimeEdit Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1>
<p>The Q3DateTimeEdit class combines a <a href="q3dateedit.html">Q3DateEdit</a> and <a href="q3timeedit.html">Q3TimeEdit</a> widget into a single widget for editing datetimes. <a href="#details">More...</a></p>
<pre> #include &lt;Q3DateTimeEdit&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qdatetimeedit">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="q3datetimeedit-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<ul>
<li><div class="fn"/><b><a href="q3datetimeedit.html#dateTime-prop">dateTime</a></b> : QDateTime</li>
</ul>
<ul>
<li><div class="fn"/>56 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="q3datetimeedit.html#Q3DateTimeEdit">Q3DateTimeEdit</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3datetimeedit.html#Q3DateTimeEdit-2">Q3DateTimeEdit</a></b> ( const QDateTime &amp; <i>datetime</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
<li><div class="fn"/><b><a href="q3datetimeedit.html#dtor.Q3DateTimeEdit">~Q3DateTimeEdit</a></b> ()</li>
<li><div class="fn"/>bool <b><a href="q3datetimeedit.html#autoAdvance">autoAdvance</a></b> () const</li>
<li><div class="fn"/>Q3DateEdit * <b><a href="q3datetimeedit.html#dateEdit">dateEdit</a></b> ()</li>
<li><div class="fn"/>QDateTime <b><a href="q3datetimeedit.html#dateTime-prop">dateTime</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="q3datetimeedit.html#setAutoAdvance">setAutoAdvance</a></b> ( bool <i>advance</i> )</li>
<li><div class="fn"/>Q3TimeEdit * <b><a href="q3datetimeedit.html#timeEdit">timeEdit</a></b> ()</li>
</ul>
<ul>
<li><div class="fn"/>201 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h3>Public Slots</h3>
<ul>
<li><div class="fn"/>virtual void <b><a href="q3datetimeedit.html#dateTime-prop">setDateTime</a></b> ( const QDateTime &amp; <i>dt</i> )</li>
</ul>
<ul>
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h3>Signals</h3>
<ul>
<li><div class="fn"/>void <b><a href="q3datetimeedit.html#valueChanged">valueChanged</a></b> ( const QDateTime &amp; <i>datetime</i> )</li>
</ul>
<ul>
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3DateTimeEdit class combines a <a href="q3dateedit.html">Q3DateEdit</a> and <a href="q3timeedit.html">Q3TimeEdit</a> widget into a single widget for editing datetimes.</p>
<p>Q3DateTimeEdit consists of a <a href="q3dateedit.html">Q3DateEdit</a> and <a href="q3timeedit.html">Q3TimeEdit</a> widget placed side by side and offers the functionality of both. The user can edit the date and time by using the keyboard or the arrow keys to increase/decrease date or time values. The Tab key can be used to move from section to section within the Q3DateTimeEdit widget, and the user can be moved automatically when they complete a section using <a href="q3datetimeedit.html#setAutoAdvance">setAutoAdvance</a>(). The datetime can be set with <a href="q3datetimeedit.html#dateTime-prop">setDateTime</a>().</p>
<p>The date format is read from the system's locale settings. It is set to year, month, day order if that is not possible. See <a href="q3dateedit.html#order-prop">Q3DateEdit::setOrder</a>() to change this. Times appear in the order hours, minutes, seconds using the 24 hour clock.</p>
<p>It is recommended that the Q3DateTimeEdit is initialised with a datetime, e.g&#x2e;</p>
<pre> Q3DateTimeEdit *dateTimeEdit = new Q3DateTimeEdit(QDateTime::currentDateTime(), this);
 dateTimeEdit-&gt;dateEdit()-&gt;setRange(QDateTime::currentDate(),
                                     QDateTime::currentDate().addDays(7));</pre>
<p>Here we've created a new Q3DateTimeEdit set to the current date and time, and set the date to have a minimum date of now and a maximum date of a week from now.</p>
<p>Terminology: A <a href="q3dateedit.html">Q3DateEdit</a> widget consists of three 'sections', one each for the year, month and day. Similarly a <a href="q3timeedit.html">Q3TimeEdit</a> consists of three sections, one each for the hour, minute and second. The character that separates each date section is specified with setDateSeparator(); similarly setTimeSeparator() is used for the time sections.</p>
<p align="center"><img src="images/datetimewidgets.png" alt="Date Time Widgets" /></p><p>See also <a href="q3dateedit.html">Q3DateEdit</a> and <a href="q3timeedit.html">Q3TimeEdit</a>.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="dateTime-prop"></a>dateTime : <a href="qdatetime.html">QDateTime</a></h3>
<p>This property holds the editor's datetime value.</p>
<p>The datetime edit's datetime which may be an invalid datetime.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>QDateTime dateTime () const</b></li>
<li><div class="fn"/><b>virtual void setDateTime ( const QDateTime &amp; <i>dt</i> )</b></li>
</ul>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="Q3DateTimeEdit"></a>Q3DateTimeEdit::Q3DateTimeEdit ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs an empty datetime edit with parent <i>parent</i> and called <i>name</i>.</p>
<h3 class="fn"><a name="Q3DateTimeEdit-2"></a>Q3DateTimeEdit::Q3DateTimeEdit ( const <a href="qdatetime.html">QDateTime</a> &amp; <i>datetime</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Constructs a datetime edit with the initial value <i>datetime</i>, parent <i>parent</i> and called <i>name</i>.</p>
<h3 class="fn"><a name="dtor.Q3DateTimeEdit"></a>Q3DateTimeEdit::~Q3DateTimeEdit ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<h3 class="fn"><a name="autoAdvance"></a>bool Q3DateTimeEdit::autoAdvance () const</h3>
<p>Returns true if auto-advance is enabled, otherwise returns false.</p>
<p>See also <a href="q3datetimeedit.html#setAutoAdvance">setAutoAdvance</a>().</p>
<h3 class="fn"><a name="dateEdit"></a><a href="q3dateedit.html">Q3DateEdit</a> * Q3DateTimeEdit::dateEdit ()</h3>
<p>Returns the internal widget used for editing the date part of the datetime.</p>
<h3 class="fn"><a name="setAutoAdvance"></a>void Q3DateTimeEdit::setAutoAdvance ( bool <i>advance</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the auto advance property of the editor to <i>advance</i>. If set to true, the editor will automatically advance focus to the next date or time section if the user has completed a section.</p>
<p>See also <a href="q3datetimeedit.html#autoAdvance">autoAdvance</a>().</p>
<h3 class="fn"><a name="timeEdit"></a><a href="q3timeedit.html">Q3TimeEdit</a> * Q3DateTimeEdit::timeEdit ()</h3>
<p>Returns the internal widget used for editing the time part of the datetime.</p>
<h3 class="fn"><a name="valueChanged"></a>void Q3DateTimeEdit::valueChanged ( const <a href="qdatetime.html">QDateTime</a> &amp; <i>datetime</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted every time the date or time changes. The <i>datetime</i> argument is the new datetime.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
